package com.ruoyi.order.service.impl;

import java.util.List;

import com.ruoyi.order.domain.MallOrderItem;
import com.ruoyi.order.mapper.MallOrderItemMapper;
import com.ruoyi.order.service.IMallOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 订单中所包含的商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-30
 */
@Service
public class MallOrderItemServiceImpl implements IMallOrderItemService
{
    @Autowired
    private MallOrderItemMapper mallOrderItemMapper;

    /**
     * 查询订单中所包含的商品
     * 
     * @param id 订单中所包含的商品主键
     * @return 订单中所包含的商品
     */
    @Override
    public MallOrderItem selectMallOrderItemById(Long id)
    {
        return mallOrderItemMapper.selectMallOrderItemById(id);
    }

    /**
     * 查询订单中所包含的商品列表
     * 
     * @param mallOrderItem 订单中所包含的商品
     * @return 订单中所包含的商品
     */
    @Override
    public List<MallOrderItem> selectMallOrderItemList(MallOrderItem mallOrderItem)
    {
        return mallOrderItemMapper.selectMallOrderItemList(mallOrderItem);
    }

    /**
     * 新增订单中所包含的商品
     * 
     * @param mallOrderItem 订单中所包含的商品
     * @return 结果
     */
    @Override
    public int insertMallOrderItem(MallOrderItem mallOrderItem)
    {
        return mallOrderItemMapper.insertMallOrderItem(mallOrderItem);
    }

    /**
     * 修改订单中所包含的商品
     * 
     * @param mallOrderItem 订单中所包含的商品
     * @return 结果
     */
    @Override
    public int updateMallOrderItem(MallOrderItem mallOrderItem)
    {
        return mallOrderItemMapper.updateMallOrderItem(mallOrderItem);
    }

    /**
     * 批量删除订单中所包含的商品
     * 
     * @param ids 需要删除的订单中所包含的商品主键
     * @return 结果
     */
    @Override
    public int deleteMallOrderItemByIds(Long[] ids)
    {
        return mallOrderItemMapper.deleteMallOrderItemByIds(ids);
    }

    /**
     * 删除订单中所包含的商品信息
     * 
     * @param id 订单中所包含的商品主键
     * @return 结果
     */
    @Override
    public int deleteMallOrderItemById(Long id)
    {
        return mallOrderItemMapper.deleteMallOrderItemById(id);
    }
}
